{template 'header'}
<div class="page store shopcategory" id="page-app-store-comment">
	{template 'nav'}
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left icon fa fa-arrow-left back" href="javascript:;"></a>
		<h1 class="title open-popup" data-popup=".popup-privilege">{$store['title']}</h1>
		<a class="icon fa pull-right {if !empty($is_favorite)}fa-favor-fill{else}fa-favor{/if}" href="javascript:;" id="btn-favorite" data-id="{$store['id']}" data-uid="{$_W['member']['uid']}"></a>
	</header>
	<div class="store-notice open-popup" data-popup=".popup-privilege">
		<span class="js-scroll-notice">
			<span class="fa fa-voice"></span>
			{if !empty($store['notice'])}
				{$store['notice']}
			{else}
				营业时间: {$store['business_hours_cn']}
			{/if}
		</span>
	</div>
	<div class="buttons-tab">
		<a href="{php echo $this->createMobileUrl('goods', array('sid' => $store['id']));}" class="button">商品</a>
		<a href="{php echo $this->createMobileUrl('store', array('sid' => $store['id'], 'op' => 'comment'));}" class="button active">评价</a>
		<a href="{php echo $this->createMobileUrl('store', array('sid' => $store['id']));}" class="button">商家</a>
	</div>
	<div class="content infinite-scroll" data-distance="50" data-min="{$min}" data-type="{$type}" data-sid="{$sid}">
		{if empty($comments)}
		<div class="common-no-con">
			<img src="{MODULE_URL}resource/app/img/comment_no_con.png" alt="" />
			<p>这个店铺还没有评价！</p>
		</div>
		{else}
		<div id="comment">
			<div class="table comment-nav">
				<div class="table-cell">
					<a href="">
						<div class="count">{$stat['score']}</div>
						<div class="">整体评价</div>
					</a>
				</div>
				<div class="table-cell">
					<a href="">
						<div class="count">{$stat['goods_quality']}</div>
						<div class="">商品质量</div>
					</a>
				</div>
				<div class="table-cell">
					<a href="">
						<div class="count">{$stat['delivery_service']}</div>
						<div class="">配送服务</div>
					</a>
				</div>
			</div>
			<div class="comment-list">
				<div class="list-item-top">
					<div class="btn-tab row no-gutter">
						<div class="col-25"><span {if !$type}class="active"{/if}><a href="{php echo $this->createMobileUrl('store', array('op' => 'comment', 'type' => 0, 'sid' => $store['id']));}">全部({$stat['all']})</a></span></div>
						<div class="col-25"><span {if $type == 1}class="active"{/if}><a href="{php echo $this->createMobileUrl('store', array('op' => 'comment', 'type' => 1, 'sid' => $store['id']));}">好评({$stat['good']})</a></span></div>
						<div class="col-25"><span {if $type == 2}class="active"{/if}><a href="{php echo $this->createMobileUrl('store', array('op' => 'comment', 'type' => 2, 'sid' => $store['id']));}">中评({$stat['middle']})</a></span></div>
						<div class="col-25"><span {if $type == 3}class="active"{/if}><a href="{php echo $this->createMobileUrl('store', array('op' => 'comment', 'type' => 3, 'sid' => $store['id']));}">差评({$stat['bad']})</a></span></div>
					</div>
					<div class="content-padded"></div>
				</div>
				<div class="list-block media-list">
					<ul>
						{loop $comments $comment}
						<li>
							<a href="javascript:;" class="item-link item-content">
								<div class="item-media">
									<img src="{$comment['avatar']}" alt="">
								</div>
								<div class="item-inner">
									<div class="item-title-row">
										<div class="item-title">{$comment['mobile']}</div>
										<div class="item-after">{$comment['addtime']}</div>
									</div>
									<div class="item-text">
										<div>
											<div class="star-rank">
												<span class="star-rank-outline">
													<span class="star-rank-active" style="width:{$comment['score']}%"></span>
												</span>
											</div>
											<span class="color-muted hide">送货速度:40分钟</span>
										</div>
										{if !empty($comment['note'])}
											<div class="comment-info">{$comment['note']}</div>
										{/if}
										{if !empty($comment['data']['good'])}
											<div class="comment-favor-oppose">
												<i class="icon favor"></i>
												{loop $comment['data']['good'] $good}
													<span>{$good}</span>
												{/loop}
											</div>
										{/if}
										{if !empty($comment['thumbs'])}
											<div class="comment-images-containter row">
												{loop $comment['thumbs'] $thumb}
												<div class="col-25 comment-images-item">
													<img src="{php echo tomedia($thumb);}" alt=""/>
												</div>
												{/loop}
											</div>
										{/if}
										{if !empty($comment['reply'])}
											<div class="store-comment">
												<div class="clearfix store-comment-top">
													店家回复<span class="pull-right">{$comment['replytime']}</span>
												</div>
												<div class="info">{$comment['reply']}</div>
											</div>
										{/if}
									</div>
								</div>
							</a>
						</li>
						{/loop}
					</ul>
				</div>
			</div>
			<div class="infinite-scroll-preloader hide">
				<div class="preloader"></div>
			</div>
		</div>
		{/if}
	</div>
</div>
<div class="popup popup-privilege">
	<div class="popup-opacity">
		<div class="content-block">
			<div class="store-name">{$store['title']}</div>
			<div class="star-rank">
				<span class="star-rank-outline">
					<span class="star-rank-active" style="width:{$store['score_cn']}%"></span>
					<span class="star-rank-value">{$store['score']}</span>
				</span>
			</div>
			<div class="sell-info">已售{$store['sailed']}份&nbsp;&nbsp;营业时间: {$store['business_hours_cn']}</div>
			<div class="evaluate">优惠活动</div>
			{if $activity['first_order_status'] == 1}
			<div class="xin text-left">
				新用户在线支付
				{loop $activity['first_order_data'] $first}
				满{$first['condition']}元减{$first['back']}元,
				{/loop}
			</div>
			{/if}
			{if $activity['discount_status'] == 1}
			<div class="minus text-left">
				在线支付
				{loop $activity['discount_data'] $discount}
				满{$first['condition']}元减{$discount['back']}元,
				{/loop}
			</div>
			{/if}
			{if $activity['grant_status'] == 1}
			<div class="zeng text-left">
				在线支付
				{loop $activity['grant_data'] $grant}
				满{$grant['$discount']}元赠{$grant['back']},
				{/loop}
			</div>
			{/if}
			{if $store['collect_coupon_status'] == 1}
			<div class="coupon text-left">
				进店可领取代金券
			</div>
			{/if}
			{if $store['delivery_free_price'] > 0}
			<div class="free text-left">
				满{$store['delivery_free_price']}元免配送费
			</div>
			{/if}
			<div class="announcement">商家公告</div>
			<div class="announcement-con">
				{if !empty($store['notice'])}
				{$store['notice']}<br>
				{/if}
				本店欢迎您下单，用餐高峰请提前下单，谢谢！
			</div>
			<p><a href="#" class="close-popup"><span class="fa fa-close"></span></a></p>
		</div>
	</div>
</div>
<script>
$(function(){
	var left = 0, notice = $(this).find('.js-scroll-notice');
	setInterval(function(){
		left--;
		0 > left + notice.width() && (left = notice.width());
		notice.css({
			'left': left
		});
	}, 25);
});
</script>
{template 'common'}
{template 'footer'}